#include <iostream>
using namespace std;
void prime(unsigned a){
    for (size_t i =2; i <= a; i++){
        if (a % i == 0){
            while (a % i == 0){
                a /= i;
            }
            cout << i << " ";
        }
    }
    cout << endl;
}
int main(){
    unsigned a;
    cin >> a;
    prime(a);
}
